package com.example.orderminiappapi.service.Impl;

import com.example.orderminiappapi.bean.AddOrUpdate;
import com.example.orderminiappapi.bean.SearchCondition;
import com.example.orderminiappapi.bean.User;
import com.example.orderminiappapi.dao.UserDao;
import com.example.orderminiappapi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User findAllUser(User user) {
        return userDao.findAllUser(user);
    }

    @Override
    public int addNewUser(User user) {
        return userDao.addNewUser(user);
    }

    @Override
    public int perfectUserInfo(User user) {
        return userDao.perfectUserInfo(user);
    }

    @Override
    public int changeRealName(AddOrUpdate addOrUpdate) {
        return userDao.changeRealName(addOrUpdate);
    }

    @Override
    public int changeSex(AddOrUpdate addOrUpdate) {
        return userDao.changeSex(addOrUpdate);
    }

    @Override
    public int changePhone(AddOrUpdate addOrUpdate) {
        return userDao.changePhone(addOrUpdate);
    }

    @Override
    public int addNewShopOwner(User user) {
        return userDao.addNewShopOwner(user);
    }

    @Override
    public User findShopOwner(User user) {
        return userDao.findShopOwner(user);
    }

    @Override
    public User signIn(User user) {
        return userDao.signIn(user);
    }

    @Override
    public List<User> getAllUsers(SearchCondition searchCondition) {
        return userDao.getAllUsers(searchCondition);
    }

    @Override
    public int getAllUsersCount(SearchCondition searchCondition) {
        return userDao.getAllUsersCount(searchCondition);
    }

    @Override
    public int managerUpdateUserInfo(User user) {
        return userDao.managerUpdateUserInfo(user);
    }
}
